import logging
import subprocess

class TBServer:
    def __init__(self,
                 logDir="runs/trains",
                 port=6006):
        self.logDir = logDir
        self.port=port

    def start(self):

        cmd = f"tensorboard --logdir='{self.logDir}' --port {self.port}"
        logging.info(cmd)
        return subprocess.Popen(cmd)
